import { defineStore } from "pinia";
export const userStore = defineStore("userData", {
  state: () => ({
    //当前登录状态
    loginStatus: false,
    //登录用户信息
    userInfo: {},
    //用户id
    userId: "",
    //私人歌单
    userPrivate: [],
  }),
  actions: {
    setMusicDetail(data) {
      this.musicDetail = data;
    },
  },
  persist: {
    enabled: true,
    strategies: [
      {
        key: "user",
        storage: localStorage,
        paths: ["loginStatus", "userInfo", "userId","userPrivate"],
      },
    ],
  },
  getters: {},
});
